<?
	error_reporting(0);
	session_start();
	
	if(!session_is_registered(myusername)){
		header("location:main_login.php");
	}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <title>Supermarket</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <link rel="stylesheet" href="style.css" type="text/css" />
</head>

<body>

<div id="container" class="clearfix">

<h1>HEMART B10<em> CABANG<?php echo " $_SESSION[namacabang]";?></em></h1>
    
	<h2></h2>
     
	<div id="content">
		
		<h3>Pencatatan Transaksi Pembelian</h3>
		<br/><br/>
		

		<?php 
		
		echo "<form method = 'post' action = 'tampil.php'>
		Produk: 
		<select name = 'produk'>";
		$dbconn = pg_connect ("host=localhost port=5432 dbname=postgres user=postgres password=leliput93");
		if (!$dbconn) {
			echo "An error occured.\n";
			exit;
		}
		
		$res = pg_query($dbconn, "select kode from supermarket.pemasok where nama = '$pemasok'");
		$kodepemasok = pg_fetch_row($res);
		
		$result = pg_query($dbconn, "select nama from supermarket.produk");
		while ( $row = pg_fetch_array($result))
				print("<option>".$row[0]."</option>");
		
		echo "
		</select><br/><br/>
		Kuantitas: <input type = 'text' name = 'kuantitas' value = '0'/></br><br/><br/>
		<input type='submit' name='pilihan' value='Tambah Transaksi' />
		<input type='submit' name='pilihan' value='Selesai Transaksi' />
		</form>
		";
	?>

	</div>
		 
			<ul id="nav">
				<li><a href="login_success.php">Home</a></li>
				<?php 
					if ($_SESSION['jabatan'] == 'Admin') 
					echo "<li><a href='form_akun.php'>Buat akun</a></li>";
				?>
				<li><a href="q1.php">List Daftar Cabang</a></li>
				<?php 
					if ($_SESSION['jabatan'] == 'Manajer Operasional')
					echo "<li><a href='pencatatan1.php'>Pencatatan Transaksi Pembelian</a></li>";
				?>
				<li><a href="daftar_transaksi1.php">Daftar Transaksi Pemasok</a></li>
				<li><a href="rekapitulasi1.php">Rekapitulasi Transaksi Pembelian</a></li>
				<li><a href="produk_terlaku.php" >Daftar Produk Terlaku</a></li>
				<li><a href="B10.php" title="View B10 info">About us</a></li>
				<li><a href="logout.php">Logout</a></li>
			</ul>
				
		</div>
		 
		<address>
			&copy; 2008 All Rights Reserved. Designed by <a href="http://www.caddoo.net" title="Portfolio of Matthew Caddoo">Matthew Caddoo</a> for <a href="http://www.zymic.com" title="Zymic Free Templates">Zymic</a> <a href="http://www.zymic.com/free-templates">Free Templates</a>. <a href="http://www.zymic.com/free-web-hosting/">Free Web Hosting</a>.
		</address>

</body>
</html>
